<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>数据统计</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 20px;
            background-color: #f0f0f0;
            color: #333;
        }
        .container {
            max-width: 1000px;
            margin: 0 auto;
            background-color: white;
            padding: 20px;
            border-radius: 5px;
            box-shadow: 0 0 10px rgba(0,0,0,0.1);
        }
        .header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding-bottom: 10px;
            border-bottom: 1px solid #eee;
            margin-bottom: 20px;
        }
        .header h1 {
            margin: 0;
            font-size: 24px;
            color: #333;
        }
        .current-time {
            font-size: 14px;
            color: #666;
        }
        table {
            width: 100%;
            border-collapse: collapse;
            margin-bottom: 20px;
        }
        th, td {
            border: 1px solid #ddd;
            padding: 10px;
            text-align: center;
        }
        th {
            background-color: #f5f5f5;
            font-weight: normal;
        }
        td {
            font-weight: bold;
            font-size: 18px;
        }
        h2 {
            font-size: 20px;
            margin: 25px 0 15px 0;
            color: #333;
            border-left: 4px solid #666;
            padding-left: 10px;
        }
        h3 {
            font-size: 16px;
            margin: 20px 0 10px 0;
            color: #555;
        }
        .divider {
            border-top: 1px solid #eee;
            margin: 20px 0;
        }
        .system-info {
            list-style-type: none;
            padding: 0;
            margin: 0;
        }
        .system-info li {
            padding: 5px 0;
            border-bottom: 1px dashed #eee;
        }
        .footer {
            margin-top: 30px;
            font-size: 12px;
            color: #999;
            text-align: center;
            line-height: 1.6;
        }
    </style>
    <script type="text/javascript" src="/tourismsystem/js/jquery-3.2.1.js"></script>
    <script type="text/javascript">
        $(function (){
            var url = "/tourismsystem/queryUserName.manager";
            $.post(url,function (data){
                $("#username").empty().html(data);
            })

            var url1 = "/tourismsystem/findNumber.manager";
            $.post(url1,function (data){
                var jsonObj = JSON.parse(data)
                $("#stat1").empty().html(jsonObj.newsNum);
                $("#stat2").empty().html(jsonObj.usersNum);
                $("#stat3").empty().html(jsonObj.pnglunNum);

            })


        })


    </script>
</head>
<body>
<div class="container">
    <div class="header">
        <h1>欢迎管理员:<span id="username"></span></h1>
        <div class="current-time" id="currentTime"></div>
    </div>

    <table>
        <thead>
        <tr>
            <th>文章数</th>
            <th>会员数</th>
            <th>评论数</th>
        </tr>
        </thead>
        <tbody>
        <tr>
            <td id="stat1"></td>
            <td id="stat2"></td>
            <td id="stat3"></td>
        </tr>
        </tbody>
    </table>

    <h2>系统通知</h2>

    <h3>查询用户上传</h3>

    <div class="divider"></div>

    <h2>系统信息</h2>

    <ul class="system-info">
        <li>网站版本</li>
        <li>服务器地址</li>
        <li>操作系统</li>
        <li>运行环境</li>
        <li>JDK版本</li>
    </ul>

    <div class="divider"></div>

    <div class="footer">
        1.2.1<br>
        https://xxxxxxxxx<br>
        2025<br>
        Toward 9<br>
        1.7
    </div>
</div>

<script>
    // 更新当前时间
    function updateCurrentTime() {
        const now = new Date();
        const options = {
            year: 'numeric',
            month: '2-digit',
            day: '2-digit',
            hour: '2-digit',
            minute: '2-digit',
            second: '2-digit',
            hour12: false
        };
        document.getElementById('currentTime').textContent = now.toLocaleString('zh-CN', options);
    }

    // 初始更新时间
    updateCurrentTime();

    // 每秒更新时间
    setInterval(updateCurrentTime, 1000);

    // 这里可以添加Ajax请求来获取统计数据
    // 只需更新对应的stat1-stat6元素的内容即可
</script>
</body>
</html>